// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Poll generated by hbm2java
 */
@Entity
@Table(name = "poll", catalog = "magento")
public class Poll implements java.io.Serializable {

	private Integer pollId;
	private CoreStore coreStore;
	private String pollTitle;
	private int votesCount;
	private Date datePosted;
	private Date dateClosed;
	private short active;
	private short closed;
	private Short answersDisplay;
	private Set pollAnswers = new HashSet(0);
	private Set coreStores = new HashSet(0);

	public Poll() {
	}

	public Poll(CoreStore coreStore, int votesCount, Date datePosted,
			short active, short closed) {
		this.coreStore = coreStore;
		this.votesCount = votesCount;
		this.datePosted = datePosted;
		this.active = active;
		this.closed = closed;
	}

	public Poll(CoreStore coreStore, String pollTitle, int votesCount,
			Date datePosted, Date dateClosed, short active, short closed,
			Short answersDisplay, Set pollAnswers, Set coreStores) {
		this.coreStore = coreStore;
		this.pollTitle = pollTitle;
		this.votesCount = votesCount;
		this.datePosted = datePosted;
		this.dateClosed = dateClosed;
		this.active = active;
		this.closed = closed;
		this.answersDisplay = answersDisplay;
		this.pollAnswers = pollAnswers;
		this.coreStores = coreStores;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "poll_id", unique = true, nullable = false)
	public Integer getPollId() {
		return this.pollId;
	}

	public void setPollId(Integer pollId) {
		this.pollId = pollId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "store_id", nullable = false)
	public CoreStore getCoreStore() {
		return this.coreStore;
	}

	public void setCoreStore(CoreStore coreStore) {
		this.coreStore = coreStore;
	}

	@Column(name = "poll_title")
	public String getPollTitle() {
		return this.pollTitle;
	}

	public void setPollTitle(String pollTitle) {
		this.pollTitle = pollTitle;
	}

	@Column(name = "votes_count", nullable = false)
	public int getVotesCount() {
		return this.votesCount;
	}

	public void setVotesCount(int votesCount) {
		this.votesCount = votesCount;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date_posted", nullable = false, length = 19)
	public Date getDatePosted() {
		return this.datePosted;
	}

	public void setDatePosted(Date datePosted) {
		this.datePosted = datePosted;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date_closed", length = 19)
	public Date getDateClosed() {
		return this.dateClosed;
	}

	public void setDateClosed(Date dateClosed) {
		this.dateClosed = dateClosed;
	}

	@Column(name = "active", nullable = false)
	public short getActive() {
		return this.active;
	}

	public void setActive(short active) {
		this.active = active;
	}

	@Column(name = "closed", nullable = false)
	public short getClosed() {
		return this.closed;
	}

	public void setClosed(short closed) {
		this.closed = closed;
	}

	@Column(name = "answers_display")
	public Short getAnswersDisplay() {
		return this.answersDisplay;
	}

	public void setAnswersDisplay(Short answersDisplay) {
		this.answersDisplay = answersDisplay;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "poll")
	public Set getPollAnswers() {
		return this.pollAnswers;
	}

	public void setPollAnswers(Set pollAnswers) {
		this.pollAnswers = pollAnswers;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "poll_store", catalog = "magento", joinColumns = { @JoinColumn(name = "poll_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "store_id", nullable = false, updatable = false) })
	public Set getCoreStores() {
		return this.coreStores;
	}

	public void setCoreStores(Set coreStores) {
		this.coreStores = coreStores;
	}

}
